package com.ser02;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/ServletTest3")
public class ServletTest3 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //String header = req.getHeader("Referer");
        //System.out.println(header);

        //Enumeration<String> headerNames = req.getHeaderNames();
        //System.out.println(headerNames.toString());//org.apache.tomcat.util.http.NamesEnumerator@23f4b6b4

        //Enumeration<String> headers = req.getHeaders("User-Agent");
        //System.out.println(headers);//org.apache.tomcat.util.http.ValuesEnumerator@5acf47ab

        //int intHeader = req.getIntHeader("User-Agent");
        //System.out.println(intHeader);

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doGet(req,resp);
    }
}
